# Contributor: Ariadne Conill <ariadne@dereferenced.org>
# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
pkgname="macifrename"
pkgver="0.1.1"
pkgrel=0
pkgdesc="stably rename NICs based on MAC addresses"
url="https://git.sr.ht/~kaniini/macifrename"
arch="all"
license="ISC"
depends=""
makedepends="linux-headers"
install=""
subpackages="$pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~kaniini/$pkgname/archive/$pkgver.tar.gz
	macifrename.initd
	macifrename.confd"
builddir="$srcdir/$pkgname-$pkgver"
options="!check"

build() {
	cd "$builddir"
	make
}

package() {
	cd "$builddir"
	make install DESTDIR="$pkgdir"

	install -D -m755 "$srcdir"/macifrename.initd "$pkgdir"/etc/init.d/macifrename
	install -D -m644 "$srcdir"/macifrename.confd "$pkgdir"/etc/conf.d/macifrename
}

sha512sums="e86d563fdbee779c4be14ce8ebffea2a25b93663c0193af93d4b986545cbd75e68457e78c16bbe085a25a719c5a0e5e6b6a006042362935ad93e4e31361efbf1  macifrename-0.1.1.tar.gz
2d7351c7cedebe9d323dc991890f598c9947cd21a3e5fd438f6a7161a36853865c6954150d1d77f5269f457241ed9e0b7ceb370ec0938c9fe344d996c25426d9  macifrename.initd
d6c28da2cd5205f4ffdf353ec88acfbb00ffbff5e984fc949b7c7e8de46ddfeba6af2c41675460599bf7fba36b661fe7b83a6e1c4bb84c0ee513410b7661c6d1  macifrename.confd"
